<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="lib/vue.js"></script>
</head>

<body>
    <div id="app">
        {{num}}
        <p><button @click='add'>add</button></p>
    </div>
    <p><button onclick="reduct()">reduct</button></p>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                num:1
            },
            methods:{
                add:function(){
                    this.num++;
                }
            }
        })
        function reduct(){
            app.$emit('reduct');
        }
        app.$on('reduct',function(){
            this.num--;
        })
    </script>

</body>

</html>